package demo;

import com.lijinjiang.beautyeye.BeautyEyeLNFHelper;

import javax.swing.*;
import java.awt.*;

/**
 * @Description TODO
 * @Author 03010430
 * @Date 2025-04-11 15:27
 */
public class JTextFieldDemo {
    public static void main(String[] args) {
        try {
            BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.translucencyAppleLike;
            BeautyEyeLNFHelper.launchBeautyEyeLNF();
        } catch (Exception ignored) {
        }

        // 创建一个JFrame对象
        JFrame frame = new JFrame("输入框");
        JPanel contentPanel = new JPanel();
        contentPanel.setLayout(new GridLayout(3, 1));


        //创建面板1
        JPanel panel1 = new JPanel();
        JLabel label1 = new JLabel("用户：");
        panel1.add(label1);
        JTextField textField1 = new JTextField();
        textField1.setPreferredSize(new Dimension(160, 36));
        panel1.add(textField1);
        //创建面板2
        JPanel panel2 = new JPanel();
        panel2.setBackground(Color.BLUE);
        JLabel label2 = new JLabel("用户：");
        panel2.add(label2);
        JTextField textField2 = new JTextField();
        textField2.setPreferredSize(new Dimension(160, 36));
        panel2.add(textField2);

        // 添加各个组件
        contentPanel.add(panel1);
        frame.add(contentPanel);

        // 设置窗口大小
        frame.setSize(new Dimension(400, 300));
        // 设置窗口居中显示
        frame.setLocationRelativeTo(null);
        // 设置窗口关闭后结束运行
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        // 设置窗口可见
        frame.setVisible(true);
    }
}
